package com.sky.Demo;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Movie[] movies = new Movie[2];
        Movie m1 = new Movie(1,"水门桥",38.9,9.8,"徐克","吴京","12万人想看");
        Movie m2 = new Movie(2,"出拳吧",39,7.8,"唐晓白","田雨","3.5万人想看");
        movies[0] = m1;
        movies[1] = m2;
        MovieOperator operator = new MovieOperator(movies);
        operator.printAllMovies();
        operator.searchById(1);

        Scanner sc = new Scanner(System.in);

        while (true) {
            System.out.println("=======电影信息系统=========");
            System.out.println("请输入操作命令");
            int command = sc.nextInt();
            switch(command){
                case 1:
                    //展示所有电影
                    operator.printAllMovies();
                    break;
                case 2:
                    //根据id查询电影
                    System.out.println("请输入你要查询电影的编号");
                    int id = sc.nextInt();
                    operator.searchById(id);
                    break;
                default:
                    System.out.println("您输入的命令有误，请输入1~2的命令");
            }
        }

    }
}
